import { useState } from "react";
import RootContext from "./context/rootContext";
import Counter from "./components/counter";
import Alert from "./components/alert";

const { Provider } = RootContext;
const Chapter13 = (props) => {
    const { title } = props;
    const [count, setCount] = useState(0);
    return (
        <div className='wrapper wrapper1'>
            <div className='page-header'>
                <h3>{title}</h3>
            </div>
            <div className='page-content'>
                <Provider value={{ count, setCount }}>
                    <Counter />
                    <Alert />
                </Provider>
            </div>
        </div>
    );
};

export default Chapter13;
